package com.why.service.impl;

import com.why.entity.TUser;
import com.why.mapper.TUserMapper;
import com.why.service.ITUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author why
 * @since 2022-02-22
 */
@Service
public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements ITUserService {

    @Resource
    private TUserMapper tUserMapper;
//    @Override
//    public boolean insertOne(TUser tUser) {
////        int insert = tUserMapper.insert(tUser);
//        this.save(tUser);
//        return this.save(tUser);
//    }
//
//    @Override
//    public boolean updateOne(TUser tUser) {
//        int insert = tUserMapper.updateById(tUser);
//        return insert>0;
//
//    }
//
    @Override
    public TUser selectList() {

        TUser tUser = tUserMapper.selectAllByName();
        return tUser;
    }

    @Override
    public int insertOne(TUser tUser) {

        return tUserMapper.insert(tUser);
    }
}
